Skip to content

Conversation

ZERICO2005
Copy link
Contributor

@ZERICO2005 ZERICO2005 commented Oct 4, 2025

Saves 45 bytes in fileioc

Changes:

  • util_ret_null_pop_ix was only used by one function, so I moved it inside that function so it could be reached by jr instead of jp
  • ld iy, 0 \ add iy, sp \ ... was changed to ld hl, 3 \ add hl, sp \ ... when no more than 2 arguments are to be retrieved from the stack. This saves at 1 byte + 1F when retrieving 2 24bit arguments for example.
  • util_set_offset was tailed called by one function, so I moved it to that function to remove a jp.
  • util_ret_neg_one does scf \ sbc hl, hl \ ret. It just so happens that ti_Delete also contains the instructions scf \ sbc hl, hl \ ret, so I moved util_ret_neg_one to the end of ti_Delete, meaning that util_ret_neg_one now takes up zero bytes of space. I did something similar with util_ret_null as well.
  • A few other minor optimizations were done, like removing the double ex de, hl in ti_Read and using inc.s bc to clear UBC instead of ld bc, 0 in util_is_slot_open.

@ZERICO2005 ZERICO2005 marked this pull request as ready for review October 10, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant